package com.zzl.ov_library.dto;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class Result {
    private Integer code;
    private String msg;
    private boolean success;
    private Object data;
    private Long count;

    private Result() {}

    public static Result ok(){
        Result r = new Result();
        r.code = 0;
        r.msg = "执行成功";
        r.success = true;
        return r;
    }

    public static Result fail(){
        Result r = new Result();
        r.code = -1;
        r.msg = "执行失败";
        r.success = false;
        return r;
    }
}
